package com.jt.common.vo;

import java.io.Serializable;

public class JsonResult implements Serializable {

	private static final long serialVersionUID = -856924038217431339L;
	private static final int SUCCESS=1;
	private static final int ERROR=0;
	/**状态码(1表示success,0表示error)*/
	private int state=SUCCESS;
	/**状态信息*/
	private String message="OK";
	/**正确数据*/
	private Object data;
	public JsonResult() {
	}
	public JsonResult(Throwable e) {
		this.state = ERROR;
		this.message=e.getMessage();
	}
	public JsonResult(int state) {
		super();
		this.state = state;
	}
	public JsonResult(String message) {
		super();
		this.message = message;
	}
	/**查询使用,封装查询结果*/
	public JsonResult(Object data) {
		super();
		this.data = data;//data名字不能改
	}
	public JsonResult(Object data,String message) {
		super();
		this.data = data;
		this.message = message;//data名字不能改
	}
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		
		this.message = message;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
}
